<template>
    <div class="app">
        <!--<div class="tablist"> <div class="tab" :class="tab==0?'activate':''" @click="changgetab(0)">新的团购</div> <div class="tab" :class="tab==1?'activate':''" @click="changgetab(1)">已加入团购</div></div>-->

        <div class="list" v-if="tab==0">
            <div class="item" v-for="(item,index) in newlists">
                <div class="info">
                    <div class="title">--团购信息--</div>
                    <div class="line">商品名称:{{item.goods_name}}</div>
                    <div class="line">商品原价:￥{{item.goods_price}}</div>
                    <div class="line">拼团单价:￥{{item.price}}</div>
                    <div class="line">奖励积分:{{item.single_integral}}</div>
                    <div class="line">奖励佣金:￥{{item.single_brokerage}}</div>
                    <div class="line">人数:{{item.current_number}}/{{item.number}}</div>
                    <div class="line">开始时间:{{item.start_datetime}}</div>
                    <div class="line">结束时间:{{item.end_datetime}}</div>
                </div>
                <div class="bottom"><div class="btn" @click="join(item.id)">加入</div></div>
            </div>
        </div>

        <div class="list" v-if="tab==1">
            <div class="item" v-for="(item,index) in mylists">
                <div class="info">
                    <div class="title">--团购信息--</div>
                    <div class="line">商品名称:{{item.goods_name}}</div>
                    <div class="line">商品原价:￥{{item.goods_price}}</div>
                    <div class="line">拼团单价:￥{{item.price}}</div>
                    <div class="line">奖励积分:{{item.single_integral}}</div>
                    <div class="line">奖励佣金:￥{{item.single_brokerage}}</div>
                    <div class="line">人数:{{item.current_number}}/{{item.number}}</div>
                    <div class="line">开始时间:{{item.start_datetime}}</div>
                    <div class="line">结束时间:{{item.end_datetime}}</div>
                    <div class="line">浏览人数:{{item.visit}}</div>
                    <div class="line">任务状态:{{item.group_go_status==0?"待完成":"已完成"}}</div>
                </div>
                <div class="bottom"><div class="btn" @click="remove(item.id)">移除</div></div>
            </div>
        </div>
    </div>

</template>
<script src="./main.js"></script>
<style lang="less" src="./main.less" scoped></style>
